// ==UserScript==
// @name         复制当前页面id
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.walmart.com/*
// @icon         https://www.google.com/s2/favicons?domain=walmart.com
// @grant        GM_registerMenuCommand
// @grant        GM_setClipboard
// @grant        unsafeWindow
// @grant        GM_xmlhttpRequest
// @updateURL    https://gitee.com/great-pacey/tampermonkey/raw/master/copy.ids.user.js
// ==/UserScript==
/* global $ */

(function() {
    'use strict';
    GM_registerMenuCommand('复制当页ID', main)
    function main(){
        var ids = [].slice.call(document.querySelectorAll('div>div[data-item-id]>a[link-identifier]')).map(i => i.getAttribute('link-identifier'))
        GM_setClipboard(JSON.parse(ids))
    }
})();